home *** CD-ROM | disk | FTP | other *** search
- Path: castle.nando.net!news
- From: actuary@nando.net (Bill McCarthy)
- Newsgroups: comp.lang.c
- Subject: Re: Q: pointers to pointers that point to structs?
- Date: 10 Feb 1996 07:51:07 GMT
- Organization: News & Observer Public Access
- Message-ID: <4fhipb$eg2@castle.nando.net>
- References: <311C1B4E.217F@mars.superlink.net>
- Reply-To: actuary@nando.net (Bill McCarthy)
- NNTP-Posting-Host: grail1319.nando.net
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <311C1B4E.217F@mars.superlink.net>, Michael Rizzo <rizzom@mars.superlink.net> writes:
- >
- > I am having trouble dereferencing a pointer to a pointer to a struct.
- >For simplicity just say the struct is:
- >struct test
- > {
- > char teststr[10];
- > int testint;
- > }
-
- Replace above with: };
-
- >
- >Now I have a function that just wants to print elements of the
- >structure:
- >
- >void f(test **temp)
-
- Replace above with: void f( struct test **temp )
-
- >{
- >printf("%s %d",(please fill in the blank))
-
- Here are two approaches:
- printf( "%s %d",(*temp)->teststr, (**temp).testint );
-
- >}
-
-
- Bill McCarthy
- actuary@nando.net
- Wendell, NC USA
-
-